function [Aset,Bset,Zset,avg_time,avg_iter,all_obj] = increment(X,viewnum,anchornum,samplenum,featurenum,lambda)
%increment 增量求解Zt
Aset=cell(viewnum,1);
Bset=cell(viewnum,1);
Zset=cell(viewnum,1);
T = zeros(anchornum, featurenum);
time = 0;
iters = 0;
all_obj = cell(viewnum-1, 1);
for t = 1:viewnum
    t 
    % B_t'*B_t 正交
    X_t = X{t};
    B_t = ini_B(X_t, featurenum);
    if t==1
         %得到初始化参数
       [A_t,Z_t,T]=initial_para(X{t}, B_t, anchornum);
    else
        tic;
        [A_f,B_f,Z_f,iters,obj]= addview(X_t,A_t,B_t,Zset{t-1},T ,iters,lambda);
        toc;
        all_obj{t-1} = obj;
        time=time+toc;
        A_t = A_f;
        B_t = B_f;
        Z_t = Z_f;
%         iters= iters+tmp_iters;
    end
    Aset{t} = A_t;
    Bset{t} = B_t;
    Zset{t} = Z_t;
% end
avg_time=time/(viewnum-1);%第一个视图为初始化视图，不算入平均时间
avg_iter=iters/(viewnum-1);
% % Z_final = HH{viewnum}./ repmat(sqrt(sum(H.^2, 2)), 1,k);
% % 后续考虑是否需要进行
end

